ASSUME CS:CODE, DS:DATA, SS:STACK
DATA segment
    INPUT_PROPMPT  DB "Please input name and score: ",'$'
    OUTPUT_PROPMPT DB "The sorted name and score : ",'$'
    SCORE_BUFFER   DB 5 DUP(0)                         ;缓存以备检查是否为数字
    UNSORTED_NAME  DW 5 DUP(0)
    UNSORTED_SCORE DB 5 DUP(0)
    SORTED_NAME    DW 5 DUP(0)
    SORTED_SCORE   DB 5 DUP(0)
DATA ends
STACK segment
          db 20 dup(0)
STACK ends
CODE segment
    start:    
              mov ax, DATA
              mov ds, ax
              lea dx, INPUT_PROPMPT
              mov ah, 09H
              int 21H
    ;打印提示输入信息

              mov cx, 5                    ; 循环录入5次
              mov bx, 0
              mov ax, UNSORTED_NAME

    GET_NAME: 
            
              mov AH,1                     ;
              int 21H
    ; 获取第一个字符存到UNSORTED_NAME
            ;   mov [bx+UNSORTED_NAME], al
              int 21H
    ; 获取第二个字符存到UNSORTED_NAME
            ;   mov [bx+1+UNSORTED_NAME], al

              add bx, 2
              loop GET_NAME


    GET_NUM:
             
            


    INKEY:    MOV AH,1                     ;
              INT 21H
              CMP AL,'Y'
              JZ  YES                      ;
              CMP AL,'y'
              JZ  YES                      ;
              CMP AL,'N'
              JZ  NO
              CMP AL,'n'
              JZ  NO
              JMP INKEY
    YES:      mov cx, 2
    NO:       mov cx, 1
    
    CHECK_NUM:                             ;

              mov ax, 4c00h                ;
              int 21h                      ;

CODE ends
end start
